// 创建路由器，并暴露

// 1. 引入createRouter
import { createRouter, createWebHashHistory } from 'vue-router';


import Home from '@/pages/Home.vue';
import About from '@/pages/About.vue';
import News from '@/pages/News.vue';

// 2. 通过createRouter创建路由实例
const router = createRouter({
    history: createWebHashHistory(), // 路由的工作模式
    // 3. 配置路由规则
    routes: [
        {
            name: "Home",
            path: '/home',
            component: Home,
        },
        {
            name: "About",
            path: '/about',
            component: About,
        },
        {
            name: "News",
            path: '/news',
            component: News,
        },
    ]
});

// 4. 暴露路由实例
export default router;  
